package com.gitee.neuray.security.auth.common.util.jwt;

import java.io.Serializable;


public class JWTInfo implements Serializable, IJWTInfo {
    private String username;
    private String userId;
    private String name;
    private String orgCode;
    private String position;
    private String avatar;
    private String orgName;
    private String wxUserId;
    private String wxToken;

    @Override
    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Override
    public String getAvatar() {
        return avatar;
    }

    @Override
    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    @Override
    public String getWxUserId() {
        return wxUserId;
    }

    public void setWxUserId(String wxUserId) {
        this.wxUserId = wxUserId;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    @Override
    public String getWxToken() {
        return wxToken;
    }

    public void setWxToken(String wxToken) {
        this.wxToken = wxToken;
    }

    public JWTInfo(String username, String userId, String name, String orgCode, String position, String avatar, String orgName, String wxUserId, String wxToken) {
        this.username = username;
        this.userId = userId;
        this.name = name;
        this.orgCode = orgCode;
        this.position = position;
        this.avatar = avatar;
        this.orgName = orgName;
        this.wxUserId = wxUserId;
        this.wxToken = wxToken;
    }

    @Override
    public String getUniqueName() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String getId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        JWTInfo jwtInfo = (JWTInfo) o;

        if (username != null ? !username.equals(jwtInfo.username) : jwtInfo.username != null) {
            return false;
        }
        return userId != null ? userId.equals(jwtInfo.userId) : jwtInfo.userId == null;

    }

    @Override
    public int hashCode() {
        int result = username != null ? username.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        return result;
    }
}
